go to previous page   go to home page   go to next page

Answer:

Image files, audio files, executable files from other programming languages, many kinds of data files, ... the list is endless.


Types of Streams

A stream object may be:

There are many types of streams. For example, a stream might be an "input, character-oriented, processing stream". Another stream might be an "byte-oriented output stream". Not only are there many types of streams, there are many ways to connect them together. The I/O aspects of a program can get complicated.

This situation is common to all industrial-strength programming languages. I/O is a big topic because of the wide variety of IO devices and the wide variety of data formats. A production language must be able to read data from sources written by any language running on any type of computer.

For example, a program might need to read data from magnetic tapes written 30 years ago by a COBOL program running on an IBM mainframe. (You would likely use byte-oriented streams for this).

Fortunately, if a program is written in Java it will use identical data formats on all computers. If a Java program running on a Macintosh writes a text file, that file can easily be read by a Java program running on a PC or on any other computer.

This is not true of most other languages. A C program running on one type of computer is unlikely to create a file that can easily be read by a C program running on another type of computer. Worse than that, two different C compilers for the same computer might use different data formats!


QUESTION 6:

A C++ program running on a IBM mainframe has written a file of integer data. Do you think that a C++ program running on a PC can read this file without trouble?